<template>
	<view style="zoom: 1;">
		<image class="W_100vw H_100vh" :src="baseImg+info.img" ></image>
		
		<view class=" fontS_10 absoluteBL flex_rowL" style="bottom: 8vh;">
			<view @click="copyCode(info.url)" class="pub_bg PTB_2 PLR_2 B_radius_max color_fff ML_2 W_26vw flex_rowC">
				复制邀请链接
			</view>
			<view @click="baocun(baseImg+info.img)" class="pub_bg PTB_2 B_radius_max color_fff ML_3 W_26vw flex_rowC">
				保存二维码
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{}
			}
		},
		onLoad() {
			this.getInfo()
		},
		methods: {
			baocun(url){
				uni.showLoading({
					
				})
				uni.downloadFile({  
					url: url, //这里为图片路径  
					success: (res) => {  
						console.log(res)
						if (res.statusCode === 200) {  
							uni.saveImageToPhotosAlbum({  
								filePath: res.tempFilePath,  
								success: function() {  
									uni.hideLoading()
									uni.showToast({  
										title: '保存成功！',  
										icon: 'none'  
									})  
								},  
								fail: function() {
									uni.hideLoading()
									uni.showToast({  
										title: '保存失败，请稍后重试！',  
										icon: 'none'  
									})  
								}  
							});  
						}  
					}  
				});  
			},
			getInfo(){
				let _this = this;
				this.$req('user/poster',{},function(res){
					_this.info = res.data;
					//console.log(res)
				})
			}
		}
	}
</script>

<style>
.title{
	position: absolute;
	top: 28vh;
	left: 30vw;
}
</style>
